<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => assert_selection(
    '<div contenteditable><p>|abc</p></div>',
    'formatBlock pre',
    '<div contenteditable><pre>|abc</pre></div>'),
    'Convert P to PRE');

test(() => assert_selection(
    '<div contenteditable><span>|abc</span></div>',
    'formatBlock h1',
    '<div contenteditable><h1><span>|abc</span></h1></div>'),
    'Wrap SPAN with H1');

test(() => assert_selection(
    '<div contenteditable><address>|abc</address></div>',
    'formatBlock p',
    '<div contenteditable><p>|abc</p></div>'),
    'Convert ADDRESS to P');

test(() => assert_selection(
    '<div contenteditable><address>|abc</address></div>',
    'formatBlock address',
    '<div contenteditable><address>|abc</address></div>'),
    'Keep existing block');
</script>
